<?php
/**
 * Created by PhpStorm.
 * User: zhd
 * Date: 2018/10/10
 * Time: 22:07
 */

namespace app\Module\Index\Controller;


use framework\controller\Controller;

class CheckAuth extends Controller
{
    protected $version;
    public    $userId;

    public function __construct()
    {
        $this->userId  = session('userId');
        $this->version = config('common')['version'];
        if (empty(session('openid')) || empty(session('userId'))) {
            header('HTTP/1.1 401 Unauthorized');
            header('status: 401 Unauthorized');
            exit();
        }
    }
}